
package com.ruoyi.system.mapstruct;

import com.ruoyi.system.domain.SysTenant;
import com.ruoyi.system.domain.bo.SysTenantBo;
import org.springframework.stereotype.Component;

@Component
public class SysTenantMappingImpl implements SysTenantMapping {

    @Override
    public SysTenant toEntity(SysTenantBo bo) {
        if (bo == null) {
            return null;
        }
        
        SysTenant entity = new SysTenant();
        entity.setTenantId(bo.getTenantId());
        entity.setContactUserName(bo.getContactUserName());
        entity.setContactPhone(bo.getContactPhone());
        entity.setCompanyName(bo.getCompanyName());
        entity.setLicenseNumber(bo.getLicenseNumber());
        entity.setAddress(bo.getAddress());
        entity.setIntro(bo.getIntro());
        entity.setDomain(bo.getDomain());
        entity.setPackageId(bo.getPackageId());
        entity.setExpireTime(bo.getExpireTime());
        entity.setAccountCount(bo.getAccountCount());
        entity.setStatus(bo.getStatus());
        return entity;
    }

    @Override
    public SysTenantBo toBo(SysTenant entity) {
        if (entity == null) {
            return null;
        }
        
        SysTenantBo bo = new SysTenantBo();
        bo.setTenantId(entity.getTenantId());
        bo.setContactUserName(entity.getContactUserName());
        bo.setContactPhone(entity.getContactPhone());
        bo.setCompanyName(entity.getCompanyName());
        bo.setLicenseNumber(entity.getLicenseNumber());
        bo.setAddress(entity.getAddress());
        bo.setIntro(entity.getIntro());
        bo.setDomain(entity.getDomain());
        bo.setPackageId(entity.getPackageId());
        bo.setExpireTime(entity.getExpireTime());
        bo.setAccountCount(entity.getAccountCount());
        bo.setStatus(entity.getStatus());
        return bo;
    }
}
